﻿using System;
using System.Collections.Generic;
using System.Text;
using OT.Module.Model;
using DevExpress.Xpo;
using System.ComponentModel;

namespace OT.Module.Facade
{
    #region OrgUtility

    internal class OrgUtility : IOrganization
    {
        Session XpoSession;
        
        public OrgUtility(Session xpo)
        {
            XpoSession = xpo;
        }

        #region IOrganization 成员

        public IOrgCompany Company
        {
            get { return new OrgCompanyUtility(XpoSession); }
        }

        public IOrgDepartment Department
        {
            get { return new OrgDepartmentUtility(XpoSession); }
        }

        public IOrgEmployee Employee
        {
            get { return new OrgEmployeeUtility(XpoSession); }
        }

        public IDepartmentPosition DepartmentPosition
        {
            get { return new OrgDeptPositionUtility(XpoSession) ; }
        }

        #endregion
    }

    #endregion

    #region OrgCompanyUtility

    internal class OrgCompanyUtility : IOrgCompany
    {
        Session XpoSession;
        public OrgCompanyUtility(Session xpo)
        {
            XpoSession = xpo;
        }

        #region IOrgCompany 成员

        public List<Org_Department> GetDepartments(string companyId)
        {
            // 根据公司ID获得下属的部门,含虚拟部门一级
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Company> GetSubCompanys(string parentCompanyId)
        {
            // 根据公司ID获得下属子公司,含虚拟公司一级
            throw new Exception("The method or operation is not implemented.");
        }

        public Org_Company GetParentCopmany(string subCompanyId)
        {
            // 获得父公司
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Company> GetPartnerCompany(string compnayId)
        {
            // 获得同级公司
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Employee> GetEmployees(string compnayId)
        {
            // 获得公司所有直属员工
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Company> GetAll()
        {
            // 获得所有公司
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Position> GetCompanyPositions(string companyId)
        {
            // 获得公司所有岗位
            throw new Exception("The method or operation is not implemented.");
        }


        public List<Org_Department> GetTrulyDepartments(string companyId)
        {
            // 根据公司ID获得真实的下属的部门
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Company> GetTrulySubCompanys(string parentCompanyId)
        {
            // 根据公司ID获得真实的下属子公司
            throw new Exception("The method or operation is not implemented.");
        }

        public Org_Company GetTrulyParentCopmany(string subCompanyId)
        {
            // 获得真实的父公司
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }

    #endregion

    #region OrgDepartmentUtility

    internal class OrgDepartmentUtility : IOrgDepartment
    {
        Session XpoSession;
        public OrgDepartmentUtility(Session xpo)
        {
            XpoSession = xpo;
        }

        #region IOrgDepartment 成员

        public Org_Company GetBelongCompany(string departmentId)
        {
            // 获得部门所属的真实的公司
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Department> GetPartnerDepartments(string departmentId)
        {
            // 获得同级部门
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Employee> GetEmployees(string departmentId)
        {
            // 获得部门所有员工
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Department> GetSubDepartments(string departmentId)
        {
            // 获得子部门
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_Position> GetDepartmentCanAddPostions(string departmentId)
        {
            // 获得部门可以增加的岗位
            throw new Exception("The method or operation is not implemented.");
        }

        public List<Org_DepPosition> GetDepartmentPositions(string departmentId)
        {
            // 获得部门现有岗位
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }

    #endregion

    #region OrgEmployeeUtility

    internal class OrgEmployeeUtility : IOrgEmployee
    {
        Session XpoSession;
        public OrgEmployeeUtility(Session xpo)
        {
            XpoSession = xpo;
        }


        #region IOrgEmployee 成员

        public Org_Company GetBelongCompany(string employeeId)
        {
            // 获得员工所在的真实的公司
            throw new Exception("The method or operation is not implemented.");
        }

        public Org_Department GetBelongDepartment(string employeeId)
        {
            // 获得员工所在的真实的部门
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }

    #endregion

    #region OrgDeptPositionUtility

    internal class OrgDeptPositionUtility : IDepartmentPosition
    {
        Session XpoSession;
        public OrgDeptPositionUtility(Session xpo)
        {
            XpoSession = xpo;
        }

        #region IDepartmentPosition 成员

        public List<Org_Employee> GetEmployees(string deptPostionId)
        {
            // 获得部门岗位上的所有员工
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }

    #endregion
}
